package test;

import java.io.File;
import java.io.UnsupportedEncodingException;

import javax.swing.JFileChooser;

public class Rename {
	public static void main(String[] args) throws UnsupportedEncodingException {
		JFileChooser chooser = new JFileChooser();
//		chooser.showOpenDialog(null);
		File f = chooser.getSelectedFile();
		System.out.println(new String(f.getName().getBytes("gbk"),"utf-8"));
		File dir=new File("/home/tarena/Desktop");
		File[] files = dir.listFiles();
//		for (File f : files) {
//			System.out.println(new String(f.getName().getBytes(),"gb2312"));
//		}
		String s = "4 in love - һǧ��һ��Ը��";
		System.out.println(new String(s.getBytes("utf-8"),"gbk"));
	}
}
